package com.nbsaas.boot.controller.product;

import com.nbsaas.boot.product.api.apis.ProductCatalogApi;
import com.nbsaas.boot.product.api.domain.request.ProductCatalogSearch;
import com.nbsaas.boot.product.api.domain.simple.ProductCatalogSimple;
import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.PageResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
*  对外控制器
*/
@RestController
@RequestMapping("/productCatalog")
public class ProductCatalogController {


    @Resource
    private ProductCatalogApi productCatalogApi;

    @RequestMapping("/search")
    public PageResponse <ProductCatalogSimple> search(ProductCatalogSearch request) {
        return productCatalogApi.search(request);
    }

    @RequestMapping("/list")
    public ListResponse<ProductCatalogSimple> list(ProductCatalogSearch request) {
        return productCatalogApi.list(request);
    }



}